package com.zhang.pojo;

// Generated 2013-1-9 17:28:57 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tables generated by hbm2java
 */
@Entity
@Table(name = "tables", catalog = "zhang")
public class Tables implements java.io.Serializable {

	private Integer id;
	private Shop shop;
	private int number;
	private String type;
	private int capacity;
	private String state;
	private Set<Order> orders = new HashSet<Order>(0);

	public Tables() {
	}

	public Tables(Shop shop, int number, String type, int capacity, String state) {
		this.shop = shop;
		this.number = number;
		this.type = type;
		this.capacity = capacity;
		this.state = state;
	}

	public Tables(Shop shop, int number, String type, int capacity,
			String state, Set<Order> orders) {
		this.shop = shop;
		this.number = number;
		this.type = type;
		this.capacity = capacity;
		this.state = state;
		this.orders = orders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Shop_ID", nullable = false)
	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@Column(name = "Number", nullable = false)
	public int getNumber() {
		return this.number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	@Column(name = "Type", nullable = false, length = 10)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "Capacity", nullable = false)
	public int getCapacity() {
		return this.capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	@Column(name = "State", nullable = false, length = 20)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tables")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

}
